package com.laolang.shop.modules.product.web.admin;

import com.laolang.shop.common.core.domain.Page;
import com.laolang.shop.common.core.domain.SimpleAjax;
import com.laolang.shop.modules.product.logic.admin.ProductAttrAdminLogic;
import com.laolang.shop.modules.product.pojo.attr.admin.vo.ProductAttrPageVo;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author khlbat
 * @version 1.0
 * @date 2020/11/4 18:54
 */
@AllArgsConstructor
@RequestMapping("admin/product/attr")
@RestController
public class ProductAttrAdminController {

    private final ProductAttrAdminLogic productAttrAdminLogic;

    @GetMapping("page")
    public SimpleAjax<Page<ProductAttrPageVo>> page(@RequestParam(value = "page", defaultValue = "1") Integer page,
                                                    @RequestParam(value = "size", defaultValue = "10") Integer size,
                                                    @RequestParam(value = "cateId", defaultValue = "0") Long cateId) {
        return SimpleAjax.ok(productAttrAdminLogic.page(page, size, cateId));
    }
}
